﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BillUI.aspx.cs" Inherits="Mortgage.Form.BillUI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Quản lý tiến chuộc / tiền lãi</title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <link href="~/Styles/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="~/Styles/slide.css" type="text/css" media="screen" />
    <script type="text/javascript" src='<%= ResolveClientUrl("~/Scripts/jquery-1.4.1.js") %>'></script>
    <script type="text/javascript" src='<%= ResolveClientUrl("~/Scripts/jquery-ui.min.js") %>'></script>
    <script type="text/javascript" src='<%= ResolveClientUrl("~/Scripts/jquery.easy-confirm-dialog.js") %>'></script>
    <script type="text/javascript" src='<%= ResolveClientUrl("~/Scripts/main.js") %>'></script>
    <script type="text/javascript" src='<%= ResolveClientUrl("~/Scripts/slide/slide.js") %>'></script>
</head>
<body>
    <div class="page">
        <form id="form1" runat="server">
        <ajaxtoolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </ajaxtoolkit:ToolkitScriptManager>
        <div class="grid" style="height: 150px;">
            <center>
                <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" BackColor="White"
                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" DataKeyNames="ID"
                    OnRowDataBound="grid_RowDataBound" CellPadding="3" OnSelectedIndexChanged="grid_SelectedIndexChanged"
                    EnableModelValidation="True">
                    <EmptyDataTemplate>
                        <div class="noData">
                            Chưa có dữ liệu tiền lời / chuộc!</div>
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" SelectImageUrl="~/Images/icon/select.gif"
                            ButtonType="Image" />
                        <asp:TemplateField HeaderText="Ngày" SortExpression="BillDate">
                            <ItemTemplate>
                                <asp:Label ID="lblBillDate" runat="server" Text='<%#  Eval("BillDate","{0:d}")   %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="150px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Lọai" SortExpression="BillType">
                            <ItemTemplate>
                                <asp:Label ID="lblBillType" runat="server" Text='<%# Mortgage.Utility.GetMorgageStatusCode(Convert.ToInt32(Eval("BillType")))   %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="MoneyAmount" HeaderText="Số tiền thu(VND)" ItemStyle-Width="150px"
                            ItemStyle-CssClass="number" DataFormatString="{0:#,# VND}" ReadOnly="True" SortExpression="MoneyAmount">
                            <ItemStyle Width="150px"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="BillDescription" HeaderText="Ghi chú" ItemStyle-Width="300px"
                            ReadOnly="True" SortExpression="BillDescription">
                            <ItemStyle Width="300px"></ItemStyle>
                        </asp:BoundField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
            </center>
        </div>
        <div class="detail">
            <fieldset>
                <legend>Nhập tiền đóng lời / chuộc &nbsp;&nbsp;
                    <asp:Button ID="btnDelete" runat="server" Text="Xóa" CssClass="btnDelete" CausesValidation="false"
                        OnClick="btnDelete_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnEdit" runat="server" Text="Cập nhật" CssClass="btnEdit" CausesValidation="false"
                        OnClick="btnEdit_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnNew" runat="server" Text="Tạo mới" CssClass="btnNew" CausesValidation="false"
                        OnClick="btnNew_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnSave" runat="server" Text="Lưu" CssClass="btnSave" ValidationGroup="bill"
                        OnClick="btnSave_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btnCancel" CausesValidation="false"
                        OnClick="btnCancel_Click" />
                    <asp:Button ID="btnClose" runat="server" Text="Đóng(X)->Refresh" CssClass="btnCancel"
                        CausesValidation="false" OnClientClick="window.close(); opener.location.reload();" />
                </legend>
                <asp:Label ID="DialogMess" runat="server" CssClass="failureNotification" />
                <table style="vertical-align: top; width: 100%;">
                    <tbody>
                        <tr>
                            <td>
                                <table style="vertical-align: top;">
                                    <thead>
                                        <th style="width: 15%; text-align: right;">
                                        </th>
                                        <th style="width: 10%;">
                                        </th>
                                        <th style="width: 10%; text-align: right;">
                                        </th>
                                        <th style="width: 20%;">
                                        </th>
                                        <th style="width: 10%; text-align: right;">
                                        </th>
                                        <th style="width: 35%;">
                                        </th>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td class="label">
                                                <label title="Số đơn:" for="fldSerialNo">
                                                    Số phiếu (No):</label>
                                            </td>
                                            <td>
                                                <asp:Label ID="fldSerialNo" runat="server" />
                                            </td>
                                            <td class="label">
                                                <label for="" title="Ngày">
                                                    Ngày:</label>
                                            </td>
                                            <td>
                                                <asp:Label ID="fldMorDate" runat="server" />
                                            </td>
                                            <td class="label">
                                                Trạng thái:
                                            </td>
                                            <td>
                                                <asp:Label ID="fldStatus" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="label">
                                                <label title="Họ tên" for="fldCustumerName">
                                                    Họ tên:</label>
                                            </td>
                                            <td>
                                                <asp:Label ID="fldCustumerName" runat="server" />
                                            </td>
                                            <td class="label">
                                                <label for="fldCustomerPhone" title="Điện thọai">
                                                    Điện thọai:</label>
                                            </td>
                                            <td>
                                                <asp:Label ID="fldCustomerPhone" runat="server" />
                                            </td>
                                            <td class="label">
                                                <label title="Địa chỉ" for="fldCustumerAddress">
                                                    Địa chỉ:
                                                </label>
                                            </td>
                                            <td>
                                                <asp:Label ID="fldCustumerAddress" runat="server" Width="95%" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="label">
                                                <label title="Tên đồ cầm" for="fldItemName">
                                                    Tên đồ vật cầm:</label>
                                            </td>
                                            <td colspan="3">
                                                <asp:Label ID="fldItemName" runat="server" />
                                            </td>
                                            <td class="label">
                                                <label title="Lọai măt hàng" for="fldItemName">
                                                    Lọai mặt hàng:</label>
                                            </td>
                                            <td>
                                                <asp:Label ID="fldInterText" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="label">
                                                <label title="Số lượng tiền (cầm)" for="fldMorMoney">
                                                    Số lượng tiền (cầm):</label>
                                            </td>
                                            <td style="font-weight: bold;" colspan="3">
                                                <asp:Label ID="fldMorMoney" runat="server" />
                                            </td>
                                            <td class="label">
                                                Lãi suất (%):
                                            </td>
                                            <td style="font-weight: bold;">
                                                <asp:Label ID="fldInterestRate" runat="server" />
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="vertical-align: top;">
                                <fieldset>
                                    <legend>Calculate / Cách tính</legend>
                                    <div style="margin-top: 5px;">
                                        <label title="Ngày" for="fldBillDate" style="vertical-align: top; font-weight: bold;">
                                            Ngày:</label>
                                        <asp:TextBox ID="fldBillDate" runat="server" CssClass="dtePicker" AutoPostBack="true"
                                            OnTextChanged="fldBillDate_TextChanged" />
                                        <asp:RequiredFieldValidator ID="reqfldBillDate" runat="server" ValidationGroup="bill"
                                            ErrorMessage="*" CssClass="failureNotification" ControlToValidate="fldBillDate" />
                                        <%-- <ajaxtoolkit:TextBoxWatermarkExtender ID="tbwfldBillDate" runat="server" TargetControlID="fldBillDate"
                                            WatermarkText="Nhập Ngày" WatermarkCssClass="watermarked" />--%>
                                        <label title="Số tiền nhận" for="fldBillMoney" style="vertical-align: top; font-weight: bold;">
                                            Số tiền nhận:</label>
                                        <asp:TextBox ID="fldBillMoney" runat="server" Width="150px" CssClass="number" />000
                                        VND
                                        <ajaxtoolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"
                                            TargetControlID="fldBillMoney" FilterType=" Numbers" />
                                        <%-- <ajaxtoolkit:TextBoxWatermarkExtender ID="tbwfldBillMoney" runat="server" TargetControlID="fldBillMoney"
                                            WatermarkText="Nhập  Số tiền nhận" WatermarkCssClass="watermarked" />--%>
                                        <asp:RequiredFieldValidator ID="reqfldBillMoney" runat="server" ValidationGroup="bill"
                                            ErrorMessage="*" CssClass="failureNotification" ControlToValidate="fldBillMoney" />
                                        <br />
                                        <label style="vertical-align: top; font-weight: bold;">
                                            Thanh tóan lọai:</label>
                                        <asp:RadioButtonList ID="rdoMortStatus" runat="server" RepeatDirection="Horizontal"
                                            RepeatLayout="Flow">
                                        </asp:RadioButtonList>
                                    </div>
                                    <label style="vertical-align: top; font-weight: bold;">
                                        Tính lãi theo:</label>
                                    <asp:RadioButtonList ID="chkCalculate" runat="server" DataTextField="Value" DataValueField="ID"
                                        AutoPostBack="true" RepeatDirection="Horizontal" RepeatLayout="Flow" OnSelectedIndexChanged="chkCalculate_SelectedIndexChanged" />
                                    <br />
                                    Ngày mốc tính tiền:<asp:Label ID="lblDateBeginCall" runat="server" />
                                    <br />
                                    <asp:Label ID="lblCalculateFomula" runat="server" Text="Kết quả tính (Lãi):" CssClass="label" />
                                    <asp:Label ID="lblCalculateResult" runat="server" Font-Bold="True" /><asp:Label ID="lblCalMortMone"
                                        runat="server" />=<asp:Label ID="lblCalTotal" runat="server" Font-Bold="True" ForeColor="#FF0066" />
                                    <br />
                                    <asp:Label ID="lblCalculateFomulaAll" runat="server" Text="Kết quả tính (Lãi+chuộc):"
                                        CssClass="label" />
                                    <asp:Label ID="lblCalculateResultAll" runat="server" Font-Bold="True" /><asp:Label
                                        ID="lblCalMortMoneAll" runat="server" />=<asp:Label ID="lblCalTotalAll" runat="server"
                                            Font-Bold="True" ForeColor="#FF0066" />
                                </fieldset>
                            </td>
                        </tr>
                        <tr>
                            <td class="label">
                                Ghi chú
                                <asp:TextBox ID="fldDescription" runat="server" TextMode="MultiLine" Width="95%" />
                                <%-- <ajaxtoolkit:TextBoxWatermarkExtender ID="tbwfldDescription" runat="server"
                                    TargetControlID="fldDescription" WatermarkText="Nhập Ghi chú" WatermarkCssClass="watermarked" />--%>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </fieldset>
            <asp:HiddenField ID="fldBillId" runat="server" />
            <ajaxtoolkit:ConfirmButtonExtender ID="cfmDelete" runat="server" ConfirmText="Bạn có thực sự muốn xóa dữ liệu này?"
                TargetControlID="btnDelete" />
        </div>
        </form>
    </div>
</body>
</html>
